import reshandler from 'services/response-handler'
/*
 * 查询活动详情
 */
function makeData(response) {
  return Object.assign({}, response, {
    "fleetActivityData": response.fleetActivityData || {
      "id": "",
      "title": "",
      "cover": "",
      "area": {
        "id": "",
        "name": "",
        "english": "",
        "parentAreaData": {
          "id": "",
          "name": "",
          "english": "",
          "parentAreaData": {
            "id": "",
            "name": "",
            "english": ""
          }
        },
        "parentParentAreaData": {
          "id": "",
          "name": "",
          "english": ""
        }
      },
      "areaStr": "",
      "address": "",
      "latBaidu": "",
      "lngBaidu": "",
      "beginDate": "",
      "endDate": "",
      "deadline": "",
      "content": "",
      "type": "1",
      "needReview": "0",
      "amount": "",
      "attendNumber": "1",
      "limitNumber": "2",
      "options": [],
      "isTop": "0",
      "isPublication": "1",
      "noteNotice": "1",
      "wechatNotice": "1",
      "appNotice": "1",
      "pushContent": "",
      "attends": [],
      "notices": [],
      "fleet": {
        "name": "",
        "fleetType": "",
        "head": "",
        "remark": "",
        "type": "",
        "memberCarPairs": [],
        "id": "",
        "ownerId": "",
        "qrCode": "",
        "messageHide": "",
        "verification": "",
        "locationInfo": "",
        "trackInfo": "",
        "carSituation": "",
        "speakForbiden": "",
        "signState": "0",
        "fenceInfo": "0",
        "driveInfo": "0",
        "location": "",
        "imGroupId": ""
      },
      "shop": {
        "logo": "",
        "childShop": [],
        "mobile": "",
        "path": "",
        "isSelected": "0",
        "templateType": "traditional",
        "name": "",
        "nickname": "",
        "head": "",
        "address": "",
        "latitude": "",
        "longitude": "",
        "qrCodePath": "",
        "email": "",
        "imid": "",
        "id": "",
        "uuid": ""
      }
    },
    "fleetActivityAttendDatas": response.fleetActivityAttendDatas || [],
    "fleetActivityOptionDatas": response.fleetActivityOptionDatas || [],
    "isin": response.isin || 0,
    "isIn": response.isIn || "0"
  })
}
export default function (params, success, fail) {
  // request 
  params = Object.assign({}, params, {
    methodName: "QueryFleetActivity",
  })

  // invoke
  this.$.get(params)
    .then(reshandler.success(success, fail, makeData), reshandler.error(fail))
}
